package com.matu.domain;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;


@JsonIgnoreProperties({"id", "revision"})
public class Ligne {
	
	@JsonProperty("_id")
    private String id;

    @JsonProperty("_rev")
    private String revision;
    
	private String nom;
	private String mode;
	private int nbLikes;
	private int nbLikesTotal;
	
	
	/**
	 * Constructeur par défaut
	 */
	public Ligne() {
		
	}
	
	
	/**
	 * Constructeur d'une ligne
	 * @param id
	 * @param nom
	 * @param code
	 * @param mode
	 * @param destination
	 */
	public Ligne(String id,String nom,String mode){
		this.id = id;
		this.nom = nom;
		this.mode = mode;
		nbLikes = 0;
		nbLikesTotal= 0;
	}
	
	
	public void addLike() {
		nbLikes++;
		nbLikesTotal++;
	}
	
	public void addUnlike() {
		nbLikes--;
		nbLikesTotal++;
	}
	
	
	/**
	 * GET&SET
	 */

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setRevision(String rev) {
        revision = rev;
    }
    
    public String getRevision() {
        return revision;
    }

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}
	
	public String getMode() {
		return mode;
	}
	
	public void setMode(String mode) {
		this.mode = mode;
	}
	
	public int getNbLikes() {
		return nbLikes;
	}

	public int getNbLikesTotal() {
		return nbLikesTotal;
	}


	public void setNbLikesTotal(int nbLikesTotal) {
		this.nbLikesTotal = nbLikesTotal;
	}
}
